import request from '@/plugins/axios/request';
// let baseURL = "http://127.0.0.1:3000/facilities"
let baseURL = process.env.VUE_APP_BASE_API + "/facilities"

// 查询设施列表
export function getFacilitiesList(queryParams) {
  return request({
    url: `${baseURL}`,
    method: 'GET',
    params: queryParams,
    isShowMessage: false
  })
}

export function getFacilitieById(id) {
  return request({
    url: `${baseURL}/${id}`,
    method: 'GET',
    isShowMessage: false
  })
}


export function addFacilities(data) {
  return request({
    url: `${baseURL}`,
    method: 'POST',
    data: data,
    isShowMessage: true
  })
}


export function updateFacilities(data) {
  return request({
    url: `${baseURL}/${data.id}`,
    method: 'PUT',
    data: data,
    isShowMessage: true
  })
}

export function deleteFacilitiesBatch(ids) {
  return request({
    url: `${baseURL}/batch`,
    method: 'DELETE',
    data: {
      ids: ids
    },
    isShowMessage: false
  })
}

export function downloadMultiple(ids) {
  return request({
    url: `${baseURL}/downloadMultiple`,
    method: 'POST',
    data: {
      ids: ids
    },
    isShowMessage: false,
    isDownLoadFile:true
  })
}

export function uploadMultiple(data) {
  return request({
    url: `${baseURL}/uploadMultiple`,
    method: 'POST',
    data: data,
    isShowMessage: false,
  })
}


